package com.hkts.naturalgas.weight.controller;


import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hkts.naturalgas.utils.CustomPageUtils;
import com.hkts.naturalgas.utils.Result;
import com.hkts.naturalgas.utils.ResultUtil;
import com.hkts.naturalgas.weight.entity.WeightTables;
import com.hkts.naturalgas.weight.service.IWeightTablesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.util.List;

/**
 * @author yck
 * @since 2022-06-13
 */
@RestController
@RequestMapping("/instrumentdata/weightTables")
public class WeightTablesController {
    private final Logger logger = LoggerFactory.getLogger(WeightTablesController.class);

    @Autowired
    public IWeightTablesService iWeightTablesService;

    /**
     * 分页查询数据
     *
     * @param page         分页信息
     * @param weightTables 查询条件
     * @return
     */
    @ResponseBody
    @GetMapping("/getWeightList")
    public Result<Object> getWeightList(int id, String date) throws ParseException {
        return iWeightTablesService.getWeightList(id, date);
    }
    @ResponseBody
    @GetMapping("/getDataList")
    public Result<Object> getDataList(int id, String date) throws ParseException {
        return iWeightTablesService.getDataList(id, date);
    }

}
